package com.googlecode.marrowboy.it;

import static org.hamcrest.MatcherAssert.*;
import static org.hamcrest.Matchers.*;

import java.io.File;

import org.apache.maven.it.Verifier;
import org.apache.maven.it.util.ResourceExtractor;
import org.junit.Test;

public class SpecificOutputDirectoryIT extends AbstractITClass {

    @Test
    public void simpleIt() throws Exception {

        File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/specific-output-dir-it");

        Verifier verifier = new Verifier(testDir.getAbsolutePath());
        this.executeGoal(verifier, "test");
        verifier.verifyErrorFreeLog();
        verifier.resetStreams();

        File reportFile = new File(testDir, "target/marrowboy/marrowboy-report.html");
        assertThat(reportFile.exists(), is(true));

        assertFileContains(reportFile, "Simple test");
        assertFileContains(reportFile, "Simple method");
    }

}
